package 第七周.experiment;

import junit.framework.TestCase;
import org.junit.Test;

public class ComplexTest extends TestCase {
    Complex a = new Complex(2, 3);
    Complex b = new Complex(4, 5);

    @Test
    public void testGetR() {
        assertEquals(2.0, a.getR());
    }

    public void testEquals() {
        assertEquals(false, a.equals(b));
    }

    public void testComplexAdd() {
        assertEquals(new Complex(6,8).toString(), a.ComplexAdd(b).toString());
    }

    public void testComplexMulti() {
        assertEquals(new Complex(-7,22).toString(), a.ComplexMulti(b).toString());
    }
}